package com.jwetherell.augmented_reality.data;

import java.util.ArrayList;
import java.util.List;

import com.jrsa.augmented_reality.Sun.*;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.location.Location;
import android.location.LocationManager;
import android.util.Log;

import com.jwetherell.augmented_reality.R;
import com.jwetherell.augmented_reality.ui.IconMarker;
import com.jwetherell.augmented_reality.ui.Marker;

public class SunDataSource extends DataSource
{
	private Location currLoc;
	private int day;
	private int month;
	private int year;
	private Resources resource;
	public SunDataSource(Resources res, Location loc, int day, int month, int year)
	{
		currLoc = loc;
		this.day = day;
		this.month = month;
		this.year = year;
		this.resource = res;
	}
	@Override
	public List<Marker> getMarkers() {
		ArrayList<Marker> markers = new ArrayList<Marker>();
		double longitude = currLoc.getLongitude();
		double latitude = currLoc.getLatitude();
		double altitude = currLoc.getAltitude();

		
		ArrayList<SunDataPoint> data = SunDataPoint.get24HourInterval(day, month, year, latitude, longitude);
		for(SunDataPoint sdp: data)
		{
			markers.add(new IconMarker(String.format("%d:00", sdp.getHour() - sdp.getZoneOffset()), latitude, longitude, sdp.getElevation(), Color.TRANSPARENT, BitmapFactory.decodeResource(resource, R.drawable.sun_icon_small)));
		}
		
		return markers;
}

}
